package controleur;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;

import extraction.DataExtraction;


public class HTMLWriter {
	
	File fic ;
	DataExtraction de ;
	String thumb ;
	
	public HTMLWriter(DataExtraction de, File fichier) {
		fic = fichier ;
		this.de = de ;
	}
	
	public void ecrit() throws FileNotFoundException {
		PrintWriter out = new PrintWriter(fic) ;
		out.println("<!DOCTYPE html>");
		out.println("<html>");
		out.println("<head>");
		out.println("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\" />");
		out.println("<meta http-equiv=\"refresh\" content=\"60\" />");
		out.println("<link rel=\"stylesheet\" type=\"text/css\" href=\"./css/styles.css\" /> ");
		out.println("<title>Essai refresh</title>");
		out.println("</head>");
		out.println("<body>");
		out.println("Date : " + de.getLastDate().toString()) ;
		out.println("</br>") ;
		out.println("</br>") ;
//		out.println("Pom : " + bdd.getLastObs().getValue("POM")) ;
		out.println("<img src=\"./images/thumb.png\"alt=\"coucou\" >") ;
		out.println("<img src=\"./images/gaugeForceVent.png\" alt=\"coucou\" >") ;
		out.println("<img src=\"./images/gaugeDirVent.png\" alt=\"coucou\" >") ;
		out.println("<img src=\"./images/clock.png\" alt=\"coucou\" >") ;
		out.println("<img src=\"./images/thermoT.png\" alt=\"coucou\" >") ;
		out.println("<img src=\"./images/pmer.png\" alt=\"coucou\" >") ;
		out.println("</body>");
		out.println("</html>");
		
		out.close();
	}
	
	
	
}
